<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Start {
            constructor(uname, age) {
                this.uname = uname
                this.age = age
            }
            sing(song) {
                console.log(this.uname + "唱" + song);
            }
        }
        var ldh = new Start("刘德华", 18)
        // var lb = new Start("18")
        console.log(ldh);
        // console.log(lb);
        ldh.sing("灰太狼")
        var sd = "我的名字是" + ldh.uname + "我今年有" + ldh.age
        console.log(sd);
    </script>
</body>

</html>